package com.example.icine;

import com.santana.icinet.to.Movie;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class Details extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_details);
		
		Bundle recdData = getIntent().getExtras();
		String myVal = recdData.getString("com.santana.icine.movie.name");
		
		Movie movie = MainActivity.movies.get(myVal);
		
		TextView text = (TextView) findViewById(R.id.name);
		text.setText(movie.getName());
		

		TextView text2 = (TextView) findViewById(R.id.location);
		text2.setText(movie.getPlace());
		
		TextView text3 = (TextView) findViewById(R.id.hours);
		String hours = "";
		for (String s : movie.getHours()) {
			hours += " " + s;
		}
		text3.setText(hours);
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.details, menu);
		return true;
	}

}
